package com.cainiao.service.deptserviceimpl;

import com.cainiao.mapper.StatisticsMapper;
import com.cainiao.pojo.EmpJobData;
import com.cainiao.pojo.OperateLog;
import com.cainiao.pojo.PageBean;
import com.cainiao.service.StatisticsService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StatisticsServiceImpl implements StatisticsService {

    @Autowired
    private StatisticsMapper statisticsMapper;


    @Override
    public PageBean page(Integer page, Integer pageSize) {
        //开启页面分页
        PageHelper.startPage(page, pageSize);
        List<OperateLog> page1 = statisticsMapper.page();
        Page<OperateLog> page2 = (Page<OperateLog>) page1;
        return new PageBean(page2.getTotal(), page2.getResult());
    }
}
